import { Controller, Post, UseGuards, Body } from '@nestjs/common';
import { AuthGuard } from '@nestjs/passport';
import { ApiBearerAuth, ApiOperation, ApiTags } from '@nestjs/swagger';
import { UserService } from '../services/user.service';
import { CreateUserDto } from './dto/create.user.dto';

@ApiTags('后台管理系统-账号管理')
@ApiBearerAuth()
@Controller('user')
export class UserController {
  constructor(private readonly userService: UserService) {}

  @ApiOperation({
    summary: '创建账号',
    description: '创建账号',
  })
  @UseGuards(AuthGuard('jwt'))
  @Post('create')
  async createUser(@Body() createUserDto: CreateUserDto): Promise<string> {
    return this.userService.createUser(createUserDto);
  }
}
